<template>
    <div>
        <h1>Father pinia示例</h1>
        <button @click="handler">点击</button>
        <hr>
        <h1>myCount:{{ myStore.myCount }}</h1>
        <h1>myCount:{{ myStore.myHello }}</h1>
        <h1>youCount:{{ youStore.youCount }}</h1>
        <h1>youCount:{{ youStore.youHello }}</h1>
    </div>
</template>

<script setup>
import {useMyStore} from './store'
import {useYouStore} from './store'

const myStore = useMyStore()

const youStore = useYouStore()

const handler = e =>{
    myStore.$patch(state=>{
        state.myCount++;
        state.myHello = myStore.myHello + Date.now()
    })

    youStore.$patch(state=>{
        state.youCount++;
        state.youHello = youStore.youHello + Date.now()
    })

}

// const youStore = useYouStore()




</script>

<style lang="scss" scoped>

</style>